package com.baizhi.mall.service.impl;

import com.baizhi.mall.entity.mysql.BzAdminRoleDO;
import com.baizhi.mall.mapper.BzAdminRoleMapper;
import com.baizhi.mall.service.IBzAdminRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhw
 * @since 2021-05-17
 */
@Service
@Transactional
public class BzAdminRoleServiceImpl extends ServiceImpl<BzAdminRoleMapper, BzAdminRoleDO> implements IBzAdminRoleService {
    @Autowired
    private BzAdminRoleMapper arm;
    @Override
    @Transactional(readOnly = true)
    public List<BzAdminRoleDO> selectAll() {
        List<BzAdminRoleDO> list = arm.selectList(null);
        return list;
    }

    @Override
    public void insert(BzAdminRoleDO adminRoleDO) {
        arm.insert(adminRoleDO);
    }

    @Override
    public void update(BzAdminRoleDO adminRoleDO) {
        arm.updateById(adminRoleDO);
    }

    @Override
    public List<BzAdminRoleDO> selectByAdminId(Integer adminId) {
        List<BzAdminRoleDO> list =arm.selectByAdminId(adminId);
        return list;
    }

    @Override
    public void deleteByAdminId(Integer adminId) {
        arm.deleteByAdminId(adminId);
    }
}
